package com.yc.navy.springmvc.controller;

import java.util.List;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.yc.navy.springmvc.bean.TypeInfo;
import com.yc.navy.springmvc.enums.ResultEnum;
import com.yc.navy.springmvc.service.ITypeInfoService;
import com.yc.navy.springmvc.vo.ResultVO;

@RestController
@RequestMapping("/type")
public class TypeInfoController {
	@Autowired
	private ITypeInfoService typeInfoService;
	
	@GetMapping("/list")
	public ResultVO list() {
		List<TypeInfo> list= typeInfoService.list();
		if(list == null || list.isEmpty()) {
			return new ResultVO(ResultEnum.DATA_NULL);
		}
		return new ResultVO(ResultEnum.SUCCESS, list);
	}
}
